import re

if __name__ == '__main__':
    text = 'This is some text -- with punctuation.'
    print('Input text            :', text)
    # word starting with 't' then another word
    regex = re.compile(r'(\bt\w+)\W+(\w+)')
    print('Pattern               :', regex.pattern)

    match = regex.search(text)
    print('Entire match          :', match.group(0))
    print('Word starting with "t":', match.group(1))
    print('Word after "t" word   :', match.group(2))

    print("groups: ", match.groups())